package cn.hanyx.coder.design.paradigm.isp;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * AtomicIntegerTest
 * getAndIncrement 方法是否符合 符合单一职责原则和接口隔离原则
 *
 * @author hanyx
 * @date 2020/07/07
 */
public class AtomicIntegerTest {

    public static void main(String[] args) {
        AtomicInteger ai = new AtomicInteger();
        for (int x = 0; x < 5; x++) {
            int num = ai.getAndIncrement();
            System.out.println(num);
        }
    }
}
